using System;
using System.Reflection.Emit;
using Pine.Core;
using Pine.SourceParser.Tree;

namespace Pine.CodeGen
{
	public static class AssignmentStatementCodeGenerator
	{
		public static void GenerateBytecode(Context ctx, Statement stmt)
		{
			AssignmentStatement assignment = (AssignmentStatement) stmt;
			CodeGenerator.ParseRightList(ctx, assignment.Content);
			
			ctx.il.Emit(OpCodes.Ldloc, ctx.list);
			ctx.il.Emit(OpCodes.Call, typeof(ValueList).GetMethod("Clear"));
		}
	}
}

